package test0ne;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;


/**
 * Created by zhangleishuidihuzhu.com on 2019/6/3.
 */
public class    TestStringFormat {

    public static String userCache = "user:c:%s";

    private static int count = 0;

    public static void main(String[] args) {

//        select agent_name, business_name from work_order_base where status = 2 and update_time BETWEEN "2020-10-30 00:00:00" and "2020-10-31 00:00:00"
        String content = "水滴筹大健康\twwb72bdb1577c65797\t1000006\t363_aVxrHDMHJXkHaubdNvBD9pE0DAjkY_pEy2ucnYI\n" +
                "水滴筹\twwb8cc2f5c0fc58917\t1000014\tMxhjtyCWPuEYVncbozQaLXUVnFuVLE9Xa0hqadE1wKk\n" +
                "水滴筹爱心平台\twwf67888370c3563f8\t1000006\tI3ChMh_YxzPDBxw-SWJFnL4qX0wOzsgOxLlfheZ3QK8\n" +
                "水滴筹服务\tww54aed0dc0e0d80ad\t1000005\ttdvPRtxDkIa_Mq2KhE67S4agYi5cYuePhXxAiiBYRHQ\n" +
                "水滴筹大病救助\tww70c287e38e3cd1b8\t1000006\tYhUrY0uOWAkm5kiSqUhcvX01iP240MlkbzGMHhdlw3s\n";


        String[] rows = content.split("\n");
        for (String row : rows) {
            String[] cols = row.split("\t");
            System.out.println("insert into channel_qx_config ( `name`, `company_id`, `qx_agent_id`, `secret`) " +
                    "values ( '" +cols[0] +"', '"+cols[1] + "','" +cols[2]+"','" + cols[3] +"');");
        }



//        String[] departments = null;
//        Map<Integer, String> depMap = new HashMap<>();
//        depMap.put(12,null);
//
////        Lists.newArrayList(depMap.values())
//        departments = depMap.values().toArray(new String[0]);
//        StringBuilder region = new StringBuilder();
//        for (int i = 0; i < departments.length; i++) {
//            region.append(departments[i].length()<4? departments[i] : departments[i].substring(3));
//            if(i != departments.length-1) {
//                region.append("\n");
//            }
//        }
//        System.out.println(region.toString());

        Date date = new Date();
        Date date1 = DateUtil.getStr2LDate("2021-04-01 00:00:00");
        System.out.println(date1 +"比较"+ date +"结果：" + date1.compareTo(date));

        LocalTime l1 = LocalTime.of(14,14,46);
        LocalTime l2 = LocalTime.of(14,56,14);
        Duration l = Duration.between(l1,l2);
        System.out.println(l.toSeconds());

        List<Long> list  = List.of(1L,2L,3L);
        System.out.println(list.contains(2L));

        }

        private static String testOne() {
        String col = "0:00:20\n" +
                "0:01:11\n" +
                "0:00:05\n" +
                "0:01:54\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:03:32\n" +
                "0:00:01\n" +
                "0:01:58\n" +
                "0:00:05\n" +
                "0:03:04\n" +
                "0:00:02\n" +
                "0:01:28\n" +
                "0:00:13\n" +
                "0:00:48\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:03\n" +
                "0:00:31\n" +
                "0:00:01\n" +
                "0:03:12\n" +
                "0:00:05\n" +
                "0:02:55\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:01\n" +
                "0:00:19\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:06\n" +
                "0:04:06\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:02:04\n" +
                "0:00:01\n" +
                "0:02:19\n" +
                "0:03:48\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:05:16\n" +
                "0:00:01\n" +
                "0:07:20\n" +
                "0:00:01\n" +
                "0:00:14\n" +
                "0:00:14\n" +
                "0:00:29\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:02\n" +
                "0:03:55\n" +
                "0:00:01\n" +
                "0:00:12\n" +
                "0:00:05\n" +
                "0:03:08\n" +
                "0:00:01\n" +
                "0:02:26\n" +
                "0:00:05\n" +
                "0:01:59\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:06\n" +
                "0:02:02\n" +
                "0:00:01\n" +
                "0:03:38\n" +
                "0:00:05\n" +
                "0:00:02\n" +
                "0:00:02\n" +
                "0:01:53\n" +
                "0:00:05\n" +
                "0:01:46\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:02:35\n" +
                "0:00:02\n" +
                "0:00:43\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:02:14\n" +
                "0:00:02\n" +
                "1:15:52\n" +
                "0:02:21\n" +
                "0:02:01\n" +
                "0:00:05\n" +
                "0:01:06\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:04:40\n" +
                "0:00:01\n" +
                "0:02:26\n" +
                "0:00:05\n" +
                "0:02:31\n" +
                "0:00:01\n" +
                "0:00:32\n" +
                "0:00:08\n" +
                "0:00:47\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:04\n" +
                "0:01:45\n" +
                "0:00:01\n" +
                "0:00:04\n" +
                "0:00:05\n" +
                "0:05:40\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:01:24\n" +
                "0:00:01\n" +
                "0:00:16\n" +
                "0:00:06\n" +
                "0:03:33\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:01:56\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:02:55\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:06:54\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:01:34\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:04:00\n" +
                "0:00:23\n" +
                "0:00:05\n" +
                "0:03:14\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:05:25\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:02:27\n" +
                "0:00:02\n" +
                "0:02:06\n" +
                "0:00:05\n" +
                "0:02:30\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:02:00\n" +
                "0:00:02\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:01:50\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:10:24\n" +
                "0:00:01\n" +
                "0:02:35\n" +
                "0:00:05\n" +
                "0:01:00\n" +
                "0:00:01\n" +
                "0:00:14\n" +
                "0:00:05\n" +
                "0:02:38\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:05\n" +
                "0:02:53\n" +
                "0:00:01\n" +
                "0:03:26\n" +
                "0:00:05\n" +
                "0:02:29\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:02:55\n" +
                "0:00:01\n" +
                "0:02:38\n" +
                "0:00:05\n" +
                "0:01:54\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:03:10\n" +
                "0:00:01\n" +
                "0:01:28\n" +
                "0:00:05\n" +
                "0:02:08\n" +
                "0:00:02\n" +
                "0:00:04\n" +
                "0:00:05\n" +
                "0:01:32\n" +
                "0:00:02\n" +
                "0:00:02\n" +
                "1:49:13\n" +
                "0:00:02\n" +
                "0:21:47\n" +
                "0:03:52\n" +
                "0:00:05\n" +
                "0:01:33\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:00:05\n" +
                "0:02:41\n" +
                "0:00:01\n" +
                "0:00:10\n" +
                "0:00:05\n" +
                "0:01:54\n" +
                "0:00:01\n" +
                "0:06:06\n" +
                "0:00:05\n" +
                "0:01:41\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:00:05\n" +
                "0:05:15\n" +
                "0:00:01\n" +
                "0:00:04\n" +
                "0:00:05\n" +
                "0:02:28\n" +
                "0:00:01\n" +
                "0:00:10\n" +
                "0:00:14\n" +
                "0:05:45\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:05\n" +
                "0:00:28\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:04:12\n" +
                "0:00:01\n" +
                "0:00:34\n" +
                "0:00:05\n" +
                "0:02:35\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "1:02:42\n" +
                "0:00:04\n" +
                "0:00:03\n" +
                "0:00:07\n" +
                "0:00:04\n" +
                "0:00:04\n" +
                "0:00:22\n" +
                "0:00:32\n" +
                "0:00:06\n" +
                "0:01:56\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:01\n" +
                "0:00:07\n" +
                "0:00:10\n" +
                "0:00:18\n" +
                "0:00:42\n" +
                "0:00:42\n" +
                "0:00:03\n" +
                "0:01:53\n" +
                "0:00:05\n" +
                "0:01:34\n" +
                "0:00:02\n" +
                "0:02:13\n" +
                "0:00:05\n" +
                "0:01:28\n" +
                "0:00:01\n" +
                "0:00:04\n" +
                "0:00:06\n" +
                "0:01:59\n" +
                "0:00:01\n" +
                "0:02:53\n" +
                "0:00:05\n" +
                "0:05:23\n" +
                "0:00:01\n" +
                "0:00:08\n" +
                "0:00:05\n" +
                "0:01:14\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:07:21\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:01:45\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:03:26\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:03:37\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:01:32\n" +
                "0:00:01\n" +
                "0:00:10\n" +
                "0:00:05\n" +
                "0:01:56\n" +
                "0:00:01\n" +
                "0:00:11\n" +
                "0:00:06\n" +
                "0:05:05\n" +
                "0:00:01\n" +
                "0:00:12\n" +
                "0:00:05\n" +
                "0:02:57\n" +
                "0:00:02\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:01:54\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:05\n" +
                "0:01:24\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:03:59\n" +
                "0:00:02\n" +
                "0:00:01\n" +
                "0:00:30\n" +
                "0:00:02\n" +
                "0:04:32\n" +
                "0:00:01\n" +
                "0:02:15\n" +
                "0:00:05\n" +
                "0:01:49\n" +
                "0:00:01\n" +
                "0:00:15\n" +
                "0:00:05\n" +
                "0:03:00\n" +
                "0:00:02\n" +
                "0:00:04\n" +
                "0:05:52\n" +
                "0:00:01\n" +
                "0:02:02\n" +
                "0:00:02\n" +
                "0:00:13\n" +
                "1:17:10\n" +
                "0:02:24\n" +
                "0:00:02\n" +
                "0:01:52\n" +
                "0:00:05\n" +
                "0:03:26\n" +
                "0:00:01\n" +
                "0:02:24\n" +
                "0:00:05\n" +
                "0:02:29\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:03:05\n" +
                "0:00:01\n" +
                "0:01:07\n" +
                "0:00:05\n" +
                "0:02:06\n" +
                "0:00:02\n" +
                "0:01:38\n" +
                "0:00:05\n" +
                "0:01:37\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:02:23\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:00:21\n" +
                "0:00:02\n" +
                "0:00:26\n" +
                "0:00:05\n" +
                "0:03:38\n" +
                "0:00:02\n" +
                "0:00:31\n" +
                "0:00:05\n" +
                "0:03:28\n" +
                "0:00:01\n" +
                "0:00:04\n" +
                "0:00:05\n" +
                "0:02:20\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:02:29\n" +
                "0:00:01\n" +
                "0:01:42\n" +
                "0:00:05\n" +
                "0:01:54\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:02\n" +
                "0:00:05\n" +
                "0:02:55\n" +
                "0:00:01\n" +
                "0:00:17\n" +
                "0:00:05\n" +
                "0:04:52\n" +
                "0:00:02\n" +
                "0:01:01\n" +
                "0:00:05\n" +
                "0:03:12\n" +
                "0:00:01\n" +
                "0:00:55\n" +
                "0:00:05\n" +
                "0:02:09\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:06\n" +
                "0:00:05\n" +
                "0:00:02\n" +
                "0:00:10\n" +
                "0:00:05\n" +
                "0:03:08\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:05\n" +
                "0:02:55\n" +
                "0:00:02\n" +
                "0:00:04\n" +
                "0:00:05\n" +
                "0:01:56\n" +
                "0:00:01\n" +
                "0:00:46\n" +
                "0:00:05\n" +
                "0:01:08\n" +
                "0:00:01\n" +
                "0:00:35\n" +
                "0:00:05\n" +
                "0:02:24\n" +
                "0:00:02\n" +
                "0:01:03\n" +
                "0:00:05\n" +
                "0:05:03\n" +
                "0:00:01\n" +
                "0:00:46\n" +
                "0:03:39\n" +
                "0:00:01\n" +
                "0:02:09\n" +
                "0:00:01\n" +
                "0:00:16\n" +
                "0:00:05\n" +
                "0:02:10\n" +
                "0:00:01\n" +
                "0:03:20\n" +
                "0:00:05\n" +
                "0:03:05\n" +
                "0:00:01\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:02:18\n" +
                "0:00:01\n" +
                "0:00:05\n" +
                "0:00:39\n" +
                "0:00:25\n" +
                "0:00:05\n" +
                "0:02:20\n" +
                "0:00:01\n" +
                "0:02:50\n" +
                "0:00:05\n" +
                "0:01:53\n" +
                "0:00:01\n" +
                "0:00:13\n" +
                "0:00:05\n" +
                "0:03:36\n" +
                "0:00:01\n" +
                "0:00:08\n" +
                "0:00:05\n" +
                "0:02:42\n" +
                "0:00:01\n" +
                "0:00:03\n" +
                "0:00:05\n" +
                "0:09:45\n" +
                "0:07:59\n" +
                "0:00:02\n" +
                "0:00:07\n" +
                "0:00:05\n" +
                "0:05:35\n" +
                "0:00:02\n" +
                "0:04:26\n" +
                "0:00:06\n";
        long result = 0l;
        long shi = 0;
        long fen = 0;
        long miao = 0;
        String[] cols = col.split("\n");
            for (String s : cols) {
                String[] mmm = s.split(":");
                shi = shi + Long.parseLong(mmm[0]);
                fen = fen + Long.parseLong(mmm[1]);
                miao = miao + Long.parseLong(mmm[1]);
            }
            System.out.println(shi + ":" + fen + ":" + miao);
            System.out.println(DateUtil.getLong2SStr(47884L));
            return result+"";

        }
}
